package com.qidian.mes.machine.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qidian.common.pojo.MESResult;
import com.qidian.mes.machine.mapper.MachineMapper;
import com.qidian.mes.machine.service.MachineService;
import com.qidian.mes.pojo.Machine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 任超
 * Time 2024/10/22 15:59
 */
@Service
public class MachineServiceImpl implements MachineService {

    @Autowired
    private MachineMapper machineMapper;

    @Override
    public MESResult selectList(Machine machine, int page, int limit) {
        PageHelper.startPage(page,limit);
        List<Machine> machines = machineMapper.selectList(machine);
        PageInfo<Machine> pageInfo = new PageInfo<>(machines);
        return MESResult.success(pageInfo);
    }
}
